/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "hksipc_fuzzer.h"

#include <cstring>
#include <securec.h>
#include <vector>
#include "message_parcel.h"

#include "file_ex.h"
#include "hks_api.h"
#include "hks_ipc_service.h"
#include "hks_log.h"
#include "hks_mem.h"
#include "hks_param.h"
#include "hks_service_ipc_serialization.h"
#include "hks_type.h"
#include "hks_type_inner.h"

#include "hks_fuzz_util.h"

namespace OHOS {
namespace Security {
namespace Hks {

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest001
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest001()
{
    HKS_LOG_I("enter HksIpcSerializationTest001");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    const char *alias = "alias";
    struct HksBlob aliasBlob = { .size = strlen(alias), .data = (uint8_t *)alias };
    struct HksParam aliasParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS, .blob = aliasBlob };
    ret = HksAddParams(paramSet, &aliasParam, 1);
    ret = HksBuildParamSet(&paramSet);
    struct HksParamOut aliasOutParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS, .blob = &aliasBlob };
    ret = HksParamSetToParams(paramSet, &aliasOutParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest002
 * @tc.desc: tdd HksParamSetToParams, expect HKS_ERROR_PARAM_NOT_EXIST
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest002()
{
    HKS_LOG_I("enter HksIpcSerializationTest002");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    const char *alias = "alias";
    struct HksBlob aliasBlob = { .size = strlen(alias), .data = (uint8_t *)alias };
    struct HksParamOut aliasOutParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS, .blob = &aliasBlob };
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &aliasOutParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest003
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest003()
{
    HKS_LOG_I("enter HksIpcSerializationTest003");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    const char *alias = "alias";
    struct HksBlob aliasBlob = { .size = strlen(alias), .data = (uint8_t *)alias };
    struct HksParamOut aliasOutParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS, .blob = &aliasBlob };
    struct HksParam aliasNullParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS + HKS_PARAM_BUFFER_NULL_INTERVAL,
        .blob = aliasBlob };
    ret = HksAddParams(paramSet, &aliasNullParam, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &aliasOutParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest004
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest004()
{
    HKS_LOG_I("enter HksIpcSerializationTest004");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    struct HksParam param = { .tag = HKS_TAG_KEY_AUTH_RESULT, .int32Param = 0 };
    int32_t outParamInt = 1;
    struct HksParamOut outParam = { .tag = HKS_TAG_KEY_AUTH_RESULT, .int32Param = &outParamInt };
    ret = HksAddParams(paramSet, &param, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &outParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest005
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest005()
{
    HKS_LOG_I("enter HksIpcSerializationTest005");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    struct HksParam param = { .tag = HKS_TAG_ACCESS_TIME, .uint32Param = 0 };
    uint32_t outParamUint = 1;
    struct HksParamOut outParam = { .tag = HKS_TAG_ACCESS_TIME, .uint32Param = &outParamUint };
    ret = HksAddParams(paramSet, &param, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &outParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest006
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest006()
{
    HKS_LOG_I("enter HksIpcSerializationTest006");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    struct HksParam param = { .tag = HKS_TAG_IF_NEED_APPEND_AUTH_INFO, .boolParam = true };
    bool outParamBool = false;
    struct HksParamOut outParam = { .tag = HKS_TAG_IF_NEED_APPEND_AUTH_INFO, .boolParam = &outParamBool };
    ret = HksAddParams(paramSet, &param, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &outParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest007
 * @tc.desc: tdd HksParamSetToParams, expect HKS_SUCCESS
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest007()
{
    HKS_LOG_I("enter HksIpcSerializationTest007");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    struct HksParam param = { .tag = HKS_TAG_KEY_ACCESS_TIME, .uint64Param = 0 };
    uint64_t outParamUint = 1;
    struct HksParamOut outParam = { .tag = HKS_TAG_KEY_ACCESS_TIME, .uint64Param = &outParamUint };
    ret = HksAddParams(paramSet, &param, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &outParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest008
 * @tc.desc: tdd HksParamSetToParams, expect HKS_ERROR_INVALID_ARGUMENT
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest008()
{
    HKS_LOG_I("enter HksIpcSerializationTest008");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    struct HksParam param = { .tag = HKS_TAG_KEY_ACCESS_TIME ^ HKS_TAG_TYPE_ULONG, .uint64Param = 0 };
    uint64_t outParamUint = 1;
    struct HksParamOut outParam = { .tag = HKS_TAG_KEY_ACCESS_TIME ^ HKS_TAG_TYPE_ULONG, .uint64Param = &outParamUint };
    ret = HksAddParams(paramSet, &param, 1);
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &outParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest009
 * @tc.desc: tdd HksParamSetToParams, expect HKS_ERROR_PARAM_NOT_EXIST
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest009()
{
    HKS_LOG_I("enter HksIpcSerializationTest009");
    struct HksParamSet *paramSet = nullptr;
    int32_t ret = HksInitParamSet(&paramSet);
    const char *alias = "alias";
    struct HksBlob aliasBlob = { .size = strlen(alias), .data = (uint8_t *)alias };
    struct HksParamOut aliasOutParam = { .tag = HKS_TAG_ATTESTATION_ID_ALIAS, .blob = &aliasBlob };
    ret = HksBuildParamSet(&paramSet);
    ret = HksParamSetToParams(paramSet, &aliasOutParam, 1);
    HksFreeParamSet(&paramSet);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest010
 * @tc.desc: tdd GetBlobFromBuffer, expect HKS_ERROR_BUFFER_TOO_SMALL
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest010()
{
    HKS_LOG_I("enter HksIpcSerializationTest010");
    const uint32_t blobSize = 15;
    const uint32_t srcBlobSize = 15;
    uint32_t index = 16;
    uint8_t blobData[blobSize] = { 0 };
    uint8_t srcBlobData[srcBlobSize] = { 0 };
    struct HksBlob blob = { .size = blobSize, .data = blobData };
    struct HksBlob srcBlob = { .size = srcBlobSize, .data = srcBlobData };

    GetBlobFromBuffer(&blob, &srcBlob, &index);
}

/**
 * @tc.name: HksIpcSerializationTest.HksIpcSerializationTest011
 * @tc.desc: tdd GetBlobFromBuffer, expect HKS_ERROR_BUFFER_TOO_SMALL
 * @tc.type: FUNC
 */
static void HksIpcSerializationTest011()
{
    HKS_LOG_I("enter HksIpcSerializationTest011");
    const uint32_t blobSize = 15;
    const uint32_t srcBlobSize = 15;
    uint32_t index = 15;
    uint8_t blobData[blobSize] = { 0 };
    uint8_t srcBlobData[srcBlobSize] = { 0 };
    struct HksBlob blob = { .size = blobSize, .data = blobData };
    struct HksBlob srcBlob = { .size = srcBlobSize, .data = srcBlobData };

    GetBlobFromBuffer(&blob, &srcBlob, &index);
}

static void HksIpcServiceTest001()
{
    HKS_LOG_I("enter HksIpcServiceTest001");
    uint8_t data[] = {
        0x20, 0x00, 0x00, 0x00, 0x41, 0x54, 0x5f, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x75, 0x61, 0x77, 0x65,
        0x69, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73,
        0x61, 0x5f, 0x43, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceGenerateKey(&srcData, context);
}

static void HksIpcServiceTest002()
{
    HKS_LOG_I("enter HksIpcServiceTest002");
    uint8_t data[] = {
        0x10, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f,
        0x6b, 0x65, 0x79, 0x00, 0x98, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
        0x28, 0x5e, 0xe2, 0x1e, 0xfe, 0x92, 0x61, 0x3d, 0xe2, 0xdf, 0x3e, 0x49, 0xbb, 0x50, 0x91, 0xc9
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceImportKey(&srcData, context);
}

static void HksIpcServiceTest003()
{
    HKS_LOG_I("enter HksIpcServiceTest003");
    uint8_t data[] = {
        0x1b, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f,
        0x6b, 0x65, 0x79, 0x5f, 0x65, 0x63, 0x64, 0x68, 0x5f, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36, 0x00,
        0x1c, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e,
        0x67, 0x4b, 0x65, 0x79, 0x5f, 0x65, 0x63, 0x64, 0x68, 0x5f, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36,
        0xf0, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x0a, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xe0, 0xb4, 0x49, 0xc3, 0x5a, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x00,
        0x17, 0x01, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
        0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
        0x42, 0x00, 0x04, 0x1a, 0xa6, 0x1b, 0xdd, 0x17, 0xcc, 0xd9, 0x4d, 0x41, 0xb5, 0x4b, 0xbd, 0xad,
        0xee, 0xef, 0xe3, 0x1a, 0x6b, 0x47, 0x87, 0x7f, 0xcb, 0x73, 0xe7, 0x51, 0xef, 0x80, 0x37, 0x89,
        0xf2, 0xd4, 0x9d, 0x85, 0xe0, 0xe9, 0x00, 0x74, 0x50, 0xa8, 0x3e, 0x58, 0xcb, 0xe5, 0x0f, 0x4b,
        0x18, 0x13, 0xae, 0x7b, 0x90, 0x7f, 0x7c, 0x20, 0x06, 0xb4, 0xc0, 0x68, 0x0f, 0xf8, 0x69, 0xe2,
        0xd0, 0x14, 0x6d, 0x10, 0x00, 0x00, 0x00, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61,
        0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x68, 0x61, 0x68, 0x61, 0x68,
        0x61, 0x68, 0x61, 0x68, 0x61, 0x68, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4a, 0xb7, 0x6f, 0xf0, 0xf4,
        0x1c, 0x75, 0x35, 0x79, 0x35, 0xc6, 0x9f, 0x51, 0xa6, 0xda, 0x7f, 0x20, 0x00, 0x00, 0x00, 0x79,
        0x44, 0x74, 0x06, 0x18, 0x78, 0xea, 0x3d, 0x53, 0xf3, 0x5d, 0xbf, 0xbc, 0x2c, 0x0b, 0x0d, 0xe6,
        0xbd, 0x28, 0x23, 0xee, 0x83, 0x97, 0xe2, 0xe3, 0x45, 0x7a, 0xc3, 0x44, 0xe6, 0x0d, 0x1a, 0x10,
        0x00, 0x00, 0x00, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x61,
        0x62, 0x61, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x68, 0x61, 0x68, 0x61, 0x68, 0x61, 0x68, 0x61, 0x68,
        0x61, 0x68, 0x00, 0x10, 0x00, 0x00, 0x00, 0xef, 0x45, 0xce, 0x59, 0xdd, 0x7a, 0xc4, 0xb7, 0xbb,
        0x79, 0xdc, 0x94, 0x1e, 0x7c, 0x2f, 0xe3, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
        0x00, 0x00, 0x00, 0xf4, 0x17, 0xb7, 0xc3, 0xc9, 0x6e, 0x3d, 0x7f, 0x91, 0x01, 0x42, 0x53, 0x74,
        0xac, 0xc0, 0x86, 0x9c, 0x41, 0x2e, 0x66, 0xa5, 0x62, 0x76, 0x42, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceImportWrappedKey(&srcData, context);
}

static void HksIpcServiceTest004()
{
    HKS_LOG_I("enter HksIpcServiceTest004");
    uint8_t data[] = {
        0x1c, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e,
        0x67, 0x4b, 0x65, 0x79, 0x5f, 0x65, 0x63, 0x64, 0x68, 0x5f, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36,
        0x00, 0x08, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceExportPublicKey(&srcData, context);
}

static void HksIpcServiceTest005()
{
    HKS_LOG_I("enter HksIpcServiceTest005");
    uint8_t data[] = {
        0x10, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f,
        0x6b, 0x65, 0x79, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceDeleteKey(&srcData, context);
}

static void HksIpcServiceTest006()
{
    HKS_LOG_I("enter HksIpcServiceTest006");
    uint8_t data[] = {
        0x14, 0x00, 0x00, 0x00, 0x70, 0x75, 0x73, 0x68, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x53, 0x69, 0x67,
        0x6e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
        0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceGetKeyParamSet(&srcData, context);
}

static void HksIpcServiceTest007()
{
    HKS_LOG_I("enter HksIpcServiceTest007");
    uint8_t data[] = {
        0x14, 0x00, 0x00, 0x00, 0x70, 0x75, 0x73, 0x68, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x53, 0x69, 0x67,
        0x6e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
        0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceKeyExist(&srcData, context);
}

static void HksIpcServiceTest008()
{
    HKS_LOG_I("enter HksIpcServiceTest008");
    uint8_t data[] = {
        0x10, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceGenerateRandom(&srcData, context);
}

static void HksIpcServiceTest009()
{
    HKS_LOG_I("enter HksIpcServiceTest009");
    uint8_t data[] = {
        0x1f, 0x00, 0x00, 0x00, 0x48, 0x6b, 0x73, 0x45, 0x43, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x56, 0x65,
        0x72, 0x69, 0x66, 0x79, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x54, 0x65, 0x73, 0x74,
        0x30, 0x31, 0x30, 0x00, 0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x48, 0x6b, 0x73, 0x5f, 0x45, 0x43, 0x43, 0x5f,
        0x53, 0x69, 0x67, 0x6e, 0x5f, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x54, 0x65, 0x73, 0x74,
        0x5f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x04, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceSign(&srcData, context);
}

static void HksIpcServiceTest010()
{
    HKS_LOG_I("enter HksIpcServiceTest010");
    uint8_t data[] = {
        0x1f, 0x00, 0x00, 0x00, 0x45, 0x43, 0x43, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x56, 0x65, 0x72,
        0x69, 0x66, 0x79, 0x5f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x4b, 0x65, 0x79, 0x41, 0x6c,
        0x69, 0x61, 0x73, 0x00, 0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x48, 0x6b, 0x73, 0x5f, 0x45, 0x43, 0x43, 0x5f,
        0x53, 0x69, 0x67, 0x6e, 0x5f, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x54, 0x65, 0x73, 0x74,
        0x5f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x00, 0x00, 0x30, 0x46, 0x02, 0x21,
        0x00, 0xc0, 0x77, 0x92, 0xea, 0xd7, 0xa9, 0xe9, 0xeb, 0x9c, 0xce, 0x5f, 0xc8, 0x26, 0x17, 0x6b,
        0x9b, 0x59, 0x7f, 0x68, 0x2a, 0xa3, 0x6d, 0xb4, 0x45, 0x82, 0x89, 0x2c, 0x82, 0x6f, 0x2f, 0x25,
        0xa2, 0x02, 0x21, 0x00, 0xfc, 0x2b, 0x05, 0xad, 0xcd, 0x31, 0xa8, 0x7e, 0xb0, 0x43, 0xe7, 0xe7,
        0x8b, 0x93, 0xf7, 0x5d, 0xc4, 0x9f, 0x2b, 0x46, 0x92, 0xa9, 0x09, 0x21, 0xd9, 0x7b, 0x50, 0x5a,
        0x43, 0xef, 0xde, 0xb1
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceVerify(&srcData, context);
}

static void HksIpcServiceTest011()
{
    HKS_LOG_I("enter HksIpcServiceTest011");
    uint8_t data[] = {
        0x17, 0x00, 0x00, 0x00, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x5f,
        0x64, 0x62, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x00, 0xff, 0x00, 0x00, 0x00,
        0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x50,
        0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc8, 0x3d, 0x2a,
        0x5b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0x3d, 0x2a, 0x5b, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x18, 0x27, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x35, 0x73, 0x30,
        0x42, 0x6f, 0x35, 0x37, 0x31, 0x4b, 0x6f, 0x71, 0x77, 0x49, 0x69, 0x36, 0x64, 0x69, 0x73, 0x74,
        0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x64, 0x61, 0x74, 0x61, 0x00, 0x20, 0x00, 0x00, 0x00,
        0x7c, 0xe5, 0xf3, 0xb0, 0x76, 0x35, 0xf1, 0xc8, 0x01, 0x9f, 0x29, 0xc7, 0xec, 0x4a, 0xac, 0x06,
        0x3f, 0x8b, 0x86, 0x97, 0x1b, 0x83, 0x77, 0x4d, 0xf6, 0xbd, 0x83, 0x77, 0x1c, 0x41, 0x97, 0x05,
        0x00, 0x01, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceEncrypt(&srcData, context);
}

static void HksIpcServiceTest012()
{
    HKS_LOG_I("enter HksIpcServiceTest012");
    uint8_t data[] = {
        0x1d, 0x00, 0x00, 0x00, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x64,
        0x62, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x6b, 0x65,
        0x79, 0x00, 0x00, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xf8, 0x7c, 0x15, 0x38, 0x5b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x50,
        0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x7d, 0x15, 0x38,
        0x5b, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x27, 0x00, 0x50,
        0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x7d, 0x15, 0x38,
        0x5b, 0x00, 0x00, 0x00, 0x18, 0x27, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x35, 0x73, 0x30,
        0x42, 0x6f, 0x35, 0x37, 0x31, 0x4b, 0x6f, 0x71, 0x77, 0x49, 0x69, 0x36, 0x64, 0x69, 0x73, 0x74,
        0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6c, 0x69, 0x65,
        0x6e, 0x74, 0x83, 0x92, 0x78, 0x29, 0x65, 0x15, 0x23, 0xe9, 0xfe, 0x9b, 0x33, 0xd3, 0x67, 0x5e,
        0xd4, 0x69, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf2, 0x2a, 0x08, 0x30, 0xa7, 0x65, 0xe5, 0xb3,
        0x2f, 0xe9, 0xf4, 0x7d, 0xc0, 0x86, 0x38, 0x59, 0x63, 0x8a, 0x97, 0x04, 0x88, 0xec, 0x3b, 0x11,
        0x09, 0x64, 0x53, 0x8f, 0x37, 0x6b, 0xe2, 0xbe, 0x83, 0x92, 0x78, 0x29, 0x65, 0x15, 0x23, 0xe9,
        0xfe, 0x9b, 0x33, 0xd3, 0x67, 0x5e, 0xd4, 0x69, 0x00, 0x01, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceDecrypt(&srcData, context);
}

static void HksIpcServiceTest013()
{
    HKS_LOG_I("enter HksIpcServiceTest013");
    uint8_t data[] = {
        0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74,
        0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x63, 0x64, 0x68,
        0x5f, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36, 0x00, 0x54, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
        0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x22, 0x3a, 0x27, 0xf9, 0xa7, 0xae, 0xa8, 0x00, 0x3b, 0x51, 0x87, 0x02, 0x52, 0x02, 0xe5, 0x68,
        0x85, 0x3f, 0xcc, 0x9c, 0x7e, 0x18, 0x94, 0x10, 0x9c, 0xcd, 0x42, 0xae, 0xe8, 0xa3, 0xcf, 0xb3,
        0xe4, 0x6a, 0x1b, 0x66, 0x66, 0x65, 0x4c, 0xec, 0x66, 0x4b, 0x50, 0x10, 0xc2, 0xa5, 0xaa, 0xc4,
        0xbd, 0xab, 0x5e, 0xf9, 0x85, 0xca, 0xe6, 0x29, 0x4a, 0xf6, 0xbc, 0x72, 0xfb, 0xba, 0x67, 0xa6,
        0x20, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceAgreeKey(&srcData, context);
}

static void HksIpcServiceTest014()
{
    HKS_LOG_I("enter HksIpcServiceTest014");
    uint8_t data[] = {
        0xa3, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
        0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xcc, 0x69, 0x93, 0x59, 0x00, 0x00, 0x00,
        0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x68, 0x65, 0x20, 0x66, 0x61, 0x63, 0x74,
        0x6f, 0x72, 0x31, 0x00, 0x18, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70,
        0x6f, 0x72, 0x74, 0x5f, 0x6b, 0x65, 0x6b, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x5f, 0x30, 0x32,
        0x10, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceDeriveKey(&srcData, context);
}

static void HksIpcServiceTest015()
{
    HKS_LOG_I("enter HksIpcServiceTest015");
    uint8_t data[] = {
        0x19, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x5f,
        0x6b, 0x65, 0x79, 0x32, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x5f, 0x30, 0x32, 0x00, 0x00, 0x00,
        0xc0, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x0a, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xb0, 0xcc, 0x69, 0x93, 0x59, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x20, 0x00, 0x00, 0x00, 0xea, 0x67, 0x5e, 0xee, 0x1d, 0xa9, 0xc5, 0x61, 0x25, 0xc3, 0xd4, 0xae,
        0x23, 0x74, 0x2a, 0x05, 0xc4, 0x1f, 0xbf, 0x57, 0x44, 0x70, 0x72, 0xb1, 0x9a, 0xcd, 0x5d, 0xe4,
        0x4c, 0x76, 0x39, 0xb4, 0x00, 0x01, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceMac(&srcData, context);
}

static void HksIpcServiceTest016()
{
    HKS_LOG_I("enter HksIpcServiceTest016");
    uint8_t data[] = {
        0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceGetKeyInfoList(&srcData, context);
}

static void HksIpcServiceTest017()
{
    HKS_LOG_I("enter HksIpcServiceTest017");
    uint8_t data[] = {
        0x20, 0x00, 0x00, 0x00, 0x41, 0x54, 0x5f, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x75, 0x61, 0x77, 0x65,
        0x69, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73,
        0x61, 0x5f, 0x43, 0x4e, 0xf1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x50,
        0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x54, 0x5c, 0xfd,
        0x5a, 0x00, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xae, 0x54, 0x5c, 0xfd, 0x5a, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x50,
        0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x54, 0x5c, 0xfd,
        0x5a, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xd1, 0x54, 0x5c, 0xfd, 0x5a, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x69, 0x5f, 0x73,
        0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x6e,
        0x66, 0x6f, 0x68, 0x69, 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x64,
        0x61, 0x74, 0x61, 0x68, 0x69, 0x5f, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
        0x5f, 0x64, 0x61, 0x74, 0x61, 0x41, 0x54, 0x5f, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x75, 0x61, 0x77,
        0x65, 0x69, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
        0x73, 0x61, 0x5f, 0x43, 0x4e, 0x00, 0x00, 0x00, 0x10, 0x30, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceAttestKey(&srcData, context, NULL);
}

static void HksIpcServiceTest018()
{
    HKS_LOG_I("enter HksIpcServiceTest018");
    uint8_t data[] = {
        0xd4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
        0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xc4, 0xc9, 0xab, 0x5a, 0x00, 0x00, 0x00,
        0x32, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x54, 0xc4, 0xc9, 0xab, 0x5a, 0x00, 0x00, 0x00, 0x48, 0x6b, 0x73, 0x48, 0x4b, 0x44, 0x46, 0x44,
        0x65, 0x72, 0x69, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x54, 0x65, 0x73,
        0x74, 0x30, 0x30, 0x34, 0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob paramSetBlob = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    const uint32_t len = 40;
    uint8_t data1[len] = { 0 };
    struct HksBlob outData = {
        .size = len,
        .data = data1
    };
    HksIpcServiceInit(&paramSetBlob, &outData, context);
}

static void HksIpcServiceTest019()
{
    HKS_LOG_I("enter HksIpcServiceTest019");
    uint8_t data[] = {
        0xc8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x31, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
        0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xcc, 0xc9, 0xab, 0x5a, 0x00, 0x00, 0x00,
        0x32, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xd0, 0xcc, 0xc9, 0xab, 0x5a, 0x00, 0x00, 0x00, 0x33, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
        0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xcc, 0xc9, 0xab, 0x5a, 0x00, 0x00, 0x00,
        0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x1a, 0x1d, 0x77, 0x00, 0x00, 0x00, 0x00, 0x48, 0x6b, 0x73, 0x5f, 0x48, 0x4b, 0x44, 0x46,
        0x5f, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x5f, 0x54, 0x65, 0x73, 0x74, 0x5f, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
        0x30, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67
    };
    const struct HksBlob paramSetBlob = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    const uint32_t len = 2048;
    uint8_t data1[len] = { 0 };
    struct HksBlob outData = {
        .size = len,
        .data = data1
    };
    HksIpcServiceUpdate(&paramSetBlob, &outData, context);
}

uint8_t finishData[] = {
    0xd8, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x31, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
    0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x7c, 0xf1, 0x42, 0x5c, 0x00, 0x00, 0x00,
    0x32, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xd0, 0x7c, 0xf1, 0x42, 0x5c, 0x00, 0x00, 0x00, 0x33, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x7c, 0xf1, 0x42, 0x5c, 0x00, 0x00, 0x00,
    0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
    0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
    0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xf3, 0xcd, 0x0a, 0x99, 0x00, 0x00, 0x00, 0x00, 0x27, 0x70, 0x53, 0xc5, 0xd1, 0x0b, 0x08, 0x57,
    0x3e, 0xba, 0xca, 0x20, 0x69, 0x5e, 0x1b, 0xb8, 0xc1, 0x17, 0x3d, 0x7d, 0x9c, 0x01, 0xd1, 0xe0,
    0x71, 0xfc, 0x5e, 0x6f, 0xd2, 0xa2, 0xab, 0xa8, 0xf5, 0x06, 0xb9, 0xb7, 0x6c, 0x32, 0x40, 0x73,
    0x7f, 0x95, 0xbb, 0x72, 0x8e, 0x8c, 0x3b, 0xdb, 0xcd, 0x41, 0x09, 0xb7, 0x14, 0x61, 0xb6, 0x5c,
    0x4c, 0x59, 0x0e, 0x50, 0xd6, 0xae, 0x56, 0xad, 0xbd, 0x6f, 0x34, 0x5b, 0xea, 0x3c, 0x14, 0xc8,
    0xa2, 0x8b, 0xd1, 0xda, 0xe0, 0x8d, 0xca, 0xec, 0xbd, 0x85, 0xa7, 0xd0, 0x7c, 0xb6, 0xcb, 0x7a,
    0x88, 0x60, 0x15, 0x39, 0x88, 0x85, 0x40, 0xf0, 0xa1, 0x4f, 0xb2, 0x97, 0x08, 0x97, 0x8f, 0x91,
    0x26, 0x73, 0xe7, 0x7c, 0x1e, 0xd9, 0x40, 0x50, 0x76, 0x60, 0xc6, 0xc6, 0x7f, 0x85, 0xf0, 0x99,
    0x77, 0xaf, 0x3a, 0x1a, 0x7e, 0xbd, 0x15, 0x82, 0xef, 0xa7, 0x12, 0x8b, 0x8c, 0x6f, 0xca, 0x9f,
    0x61, 0xb7, 0x10, 0xb5, 0x20, 0x46, 0xae, 0xdf, 0x40, 0xe0, 0xd3, 0x79, 0x96, 0xbd, 0x2d, 0xa0,
    0xda, 0xf1, 0x91, 0x84, 0x24, 0xa4, 0x7d, 0xbf, 0x3b, 0x95, 0xb5, 0xf3, 0xdd, 0x20, 0x98, 0x17,
    0x5f, 0x27, 0xb7, 0x87, 0x39, 0xdb, 0x26, 0x65, 0xd9, 0x67, 0x2f, 0xcd, 0x5c, 0x88, 0x79, 0x40,
    0xa9, 0x63, 0x1f, 0x64, 0x05, 0xed, 0x80, 0x9f, 0xc7, 0x6a, 0x0f, 0xd3, 0xac, 0xa7, 0x2d, 0xf0,
    0x6a, 0x87, 0xfb, 0x4e, 0x80, 0xa0, 0x59, 0xf3, 0x07, 0xbf, 0x2a, 0x42, 0xb0, 0x6f, 0x7e, 0xa2,
    0xbd, 0xa9, 0xcf, 0x19, 0xd0, 0x7c, 0x46, 0x36, 0x1a, 0x9e, 0xdc, 0x62, 0x79, 0x95, 0x8b, 0x2b,
    0x38, 0x22, 0x88, 0x7d, 0x4f, 0x3a, 0xca, 0xd2, 0x18, 0xf4, 0x61, 0x11, 0xdb, 0x9b, 0xe1, 0x7a,
    0x31, 0xa1, 0x84, 0xcd, 0x7f, 0xa3, 0x9f, 0x8b, 0xd2, 0xa0, 0x68, 0xd7, 0xc0, 0x77, 0x83, 0x0d,
    0x0e, 0x0f, 0xae, 0xfb, 0xc1, 0x0c, 0xd2, 0x26, 0xea, 0x77, 0x46, 0x1d, 0xab, 0xa1, 0x32, 0x81,
    0x7d, 0xf6, 0xc2, 0x00, 0x38, 0x3a, 0x7f, 0x7c, 0x24, 0xbf, 0xc1, 0x6d, 0xf1, 0xcb, 0x99, 0x04,
    0x6e, 0x18, 0xa2, 0x95, 0x00, 0xff, 0x74, 0xbe, 0x79, 0xe3, 0x2d, 0x82, 0x2c, 0xf4, 0x5b, 0xd2,
    0xbc, 0xed, 0x45, 0x27, 0x7e, 0xff, 0x16, 0x53, 0xd6, 0xff, 0x38, 0xfd, 0x35, 0x93, 0xe1, 0x79,
    0x9e, 0xc1, 0xcc, 0xf0, 0xd0, 0xa9, 0x86, 0xc6, 0x52, 0x8c, 0x8f, 0x76, 0xbd, 0x9f, 0x97, 0xd1,
    0xd1, 0x71, 0x30, 0x21, 0xbb, 0x84, 0x52, 0xee, 0xbe, 0xea, 0xbd, 0x47, 0x90, 0xdc, 0xff, 0x11,
    0xed, 0x61, 0x92, 0xd1, 0xcf, 0xc3, 0x62, 0xc4, 0xb4, 0x4e, 0xd2, 0x80, 0x3f, 0xdf, 0x04, 0xc4,
    0x49, 0x05, 0xdb, 0x22, 0xea, 0x32, 0x64, 0x7d, 0x90, 0x96, 0x7f, 0xd3, 0xb9, 0x3b, 0x36, 0x38,
    0xc8, 0x0b, 0x09, 0x7e, 0x44, 0x5e, 0x4c, 0xa9, 0xfc, 0x31, 0x4d, 0x89, 0x36, 0x14, 0xa0, 0x26,
    0x6e, 0xeb, 0x5b, 0xa6, 0x9a, 0xcc, 0x96, 0x58, 0x23, 0x59, 0x5e, 0xe1, 0x81, 0x1c, 0x29, 0xc7,
    0x63, 0xd8, 0xcc, 0xd6, 0x34, 0x06, 0xc4, 0x83, 0xc2, 0xa1, 0xd7, 0xa6, 0x66, 0xd2, 0xbb, 0x78,
    0xc5, 0x0a, 0x17, 0x48, 0x8b, 0xaa, 0x47, 0xf8, 0x42, 0x06, 0xd9, 0x0c, 0x7d, 0x62, 0xae, 0x80,
    0xcf, 0xe3, 0x1c, 0x1f, 0xa7, 0x24, 0xb0, 0x61, 0x71, 0x6a, 0x9e, 0xc7, 0xe0, 0x6d, 0xda, 0xd4,
    0x1d, 0xfc, 0xac, 0x23, 0x95, 0xca, 0x29, 0x34, 0x15, 0xcf, 0x4b, 0x6f, 0x13, 0x5f, 0x47, 0x4c,
    0x96, 0xcf, 0xd1, 0x39, 0x66, 0x75, 0x84, 0xa2, 0x74, 0x03, 0xb5, 0x98, 0x2b, 0x9d, 0x0a, 0x2b,
    0x64, 0x1b, 0xb1, 0x4b, 0x32, 0xb2, 0x46, 0xf8
};
static void HksIpcServiceTest020()
{
    HKS_LOG_I("enter HksIpcServiceTest020");
    const struct HksBlob paramSetBlob = {
        .size = sizeof(finishData) / sizeof(finishData[0]),
        .data = finishData
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    const uint32_t len = 66048;
    uint8_t data1[len] = { 0 };
    struct HksBlob outData = {
        .size = len,
        .data = data1
    };
    HksIpcServiceFinish(&paramSetBlob, &outData, context);
}

static void HksIpcServiceTest021()
{
    HKS_LOG_I("enter HksIpcServiceTest021");
    uint8_t data[] = {
        0xa8, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
        0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xcc, 0x69, 0x93, 0x59, 0x00, 0x00, 0x00,
        0x32, 0x75, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xa0, 0xcc, 0x69, 0x93, 0x59, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
        0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
        0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x41, 0x64, 0xbf, 0x63, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob paramSetBlob = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    struct HksBlob outData = {
        .size = 0,
        .data = NULL
    };
    HksIpcServiceAbort(&paramSetBlob, &outData, context);
}

static void HksIpcServiceTest022()
{
    HKS_LOG_I("enter HksIpcServiceTest022");
    uint8_t data[] = {
        0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    const struct HksBlob srcData = {
        .size = sizeof(data) / sizeof(data[0]),
        .data = data
    };
    MessageParcel reply;
    uint8_t *context = reinterpret_cast<uint8_t *>(&reply);
    HksIpcServiceListAliases(&srcData, context);
}
}
}
}

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
    (void)data;
    (void)size;
    OHOS::Security::Hks::HksIpcSerializationTest001();
    OHOS::Security::Hks::HksIpcSerializationTest002();
    OHOS::Security::Hks::HksIpcSerializationTest003();
    OHOS::Security::Hks::HksIpcSerializationTest004();
    OHOS::Security::Hks::HksIpcSerializationTest005();
    OHOS::Security::Hks::HksIpcSerializationTest006();
    OHOS::Security::Hks::HksIpcSerializationTest007();
    OHOS::Security::Hks::HksIpcSerializationTest008();
    OHOS::Security::Hks::HksIpcSerializationTest009();
    OHOS::Security::Hks::HksIpcSerializationTest010();
    OHOS::Security::Hks::HksIpcSerializationTest011();
    OHOS::Security::Hks::HksIpcServiceTest001();
    OHOS::Security::Hks::HksIpcServiceTest002();
    OHOS::Security::Hks::HksIpcServiceTest003();
    OHOS::Security::Hks::HksIpcServiceTest004();
    OHOS::Security::Hks::HksIpcServiceTest005();
    OHOS::Security::Hks::HksIpcServiceTest006();
    OHOS::Security::Hks::HksIpcServiceTest007();
    OHOS::Security::Hks::HksIpcServiceTest008();
    OHOS::Security::Hks::HksIpcServiceTest009();
    OHOS::Security::Hks::HksIpcServiceTest010();
    OHOS::Security::Hks::HksIpcServiceTest011();
    OHOS::Security::Hks::HksIpcServiceTest012();
    OHOS::Security::Hks::HksIpcServiceTest013();
    OHOS::Security::Hks::HksIpcServiceTest014();
    OHOS::Security::Hks::HksIpcServiceTest015();
    OHOS::Security::Hks::HksIpcServiceTest016();
    OHOS::Security::Hks::HksIpcServiceTest017();
    OHOS::Security::Hks::HksIpcServiceTest018();
    OHOS::Security::Hks::HksIpcServiceTest019();
    OHOS::Security::Hks::HksIpcServiceTest020();
    OHOS::Security::Hks::HksIpcServiceTest021();
    OHOS::Security::Hks::HksIpcServiceTest022();

    return 0;
}
